Copy attribute value from Heading line to objects below

I have a document structure in DOORS with test data captured at the heading level.  I want that info copied down to every reqt under that heading.  I think i had this dxl somewhere and i cant find it now.  thought it was in the kitchen scripts but no luck either... hope this example below helps... thanks!

object head and text                 test events

3.2.2 Data collection                LUT, IOTE

system shall....                           blank

system shall....                           blank


bmohamed - Wed Feb 10 12:08:55 EST 2016

Re: Copy attribute value from Heading line to objects below
DOORSHAM - Mon Feb 15 14:58:29 EST 2016

You were a little unclear on what you wanted so the following is only meant to get you started and for your refinement.

 

// copy attributes down from heading
/**/
Object o
Module m =current
string s, sA=""
for o in m do
{ s=o."Object Heading"
  if(s> "") sA= o."test events"
   else o."test events" = sA
}
refresh m
ack "Done"

Re: Copy attribute value from Heading line to objects below
bmohamed - Mon Feb 22 11:27:06 EST 2016

DOORSHAM - Mon Feb 15 14:58:29 EST 2016

You were a little unclear on what you wanted so the following is only meant to get you started and for your refinement.

 

// copy attributes down from heading
/**/
Object o
Module m =current
string s, sA=""
for o in m do
{ s=o."Object Heading"
  if(s> "") sA= o."test events"
   else o."test events" = sA
}
refresh m
ack "Done"

Worked perfectly.  For anyone using this do the following.  Run this code from the 'edit dxl' window and then change 'test events' to the attribute you need copied.  Make that change in both places.

Thanks again, DOORSHAM